/* 工具类样式文件 - 专业版选股系统工具类和响应式样式 */

/* ============================================================================ 
   实用工具类
   ============================================================================ */

.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.p-4 {
    padding: 1.5rem;
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.card-shadow {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

.card-shadow:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ============================================================================ 
   响应式设计
   ============================================================================ */

/* 大屏幕响应式 */
@media (max-width: 1200px) {
    .tab-content,
    .performance-tab-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .performance-page .tab-content,
    .import-page .tab-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .performance-page .results-panel,
    .performance-page .control-panel,
    .import-page .results-panel,
    .import-page .control-panel,
    .news-tab-content .news-results-panel,
    .news-tab-content .news-control-panel {
        grid-column: 1;
        grid-row: auto;
    }
    
    .performance-header-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .performance-stats-overview {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    
    .performance-filters {
        min-width: auto;
        width: 100%;
    }
    
    .stats-overview {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 16px;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    /* 专业版页面表格列宽度调整 */
    .advanced-results-table th:nth-child(1),
    .advanced-results-table td:nth-child(1) {
        width: 80px;
        min-width: 80px;
    }
    
    .advanced-results-table th:nth-child(2),
    .advanced-results-table td:nth-child(2) {
        width: 100px;
        min-width: 100px;
    }
    
    .advanced-results-table th:nth-child(3),
    .advanced-results-table td:nth-child(3) {
        width: 120px;
        min-width: 120px;
    }
    
    .advanced-results-table th:nth-child(4),
    .advanced-results-table td:nth-child(4) {
        width: 80px;
        min-width: 80px;
    }
    
    .advanced-results-table th:nth-child(5),
    .advanced-results-table td:nth-child(5) {
        width: 80px;
        min-width: 80px;
    }
    
    .advanced-results-table th:nth-child(6),
    .advanced-results-table td:nth-child(6) {
        width: 100px;
        min-width: 100px;
    }
    
    .advanced-results-table th:nth-child(7),
    .advanced-results-table td:nth-child(7) {
        width: 100px;
        min-width: 100px;
    }
    
    /* 收益分析页面表格列宽度调整 */
    .performance-table th:nth-child(1),
    .performance-table td:nth-child(1) {
        width: 80px;
        min-width: 80px;
    }
    
    .performance-table th:nth-child(2),
    .performance-table td:nth-child(2) {
        width: 80px;
        min-width: 80px;
    }
    
    .performance-table th:nth-child(3),
    .performance-table td:nth-child(3) {
        width: 100px;
        min-width: 100px;
    }
    
    .performance-table th:nth-child(4),
    .performance-table td:nth-child(4) {
        width: 100px;
        min-width: 100px;
    }
    
    .performance-table th:nth-child(5),
    .performance-table td:nth-child(5) {
        width: 80px;
        min-width: 80px;
    }
    
    .performance-table th:nth-child(6),
    .performance-table td:nth-child(6) {
        width: 80px;
        min-width: 80px;
    }
    
    .performance-table th:nth-child(7),
    .performance-table td:nth-child(7) {
        width: 80px;
        min-width: 80px;
    }
    
    .performance-table th:nth-child(8),
    .performance-table td:nth-child(8) {
        width: 80px;
        min-width: 80px;
    }
    
    .performance-table th:nth-child(9),
    .performance-table td:nth-child(9) {
        width: 80px;
        min-width: 80px;
    }
    
    .performance-table th:nth-child(10),
    .performance-table td:nth-child(10) {
        width: 80px;
        min-width: 80px;
    }
    
    .performance-table th:nth-child(11),
    .performance-table td:nth-child(11) {
        width: 80px;
        min-width: 80px;
    }
    
    .performance-table th:nth-child(12),
    .performance-table td:nth-child(12) {
        width: 80px;
        min-width: 80px;
    }
    
    .performance-table th:nth-child(13),
    .performance-table td:nth-child(13) {
        width: 80px;
        min-width: 80px;
    }
    
    .performance-table th:nth-child(14),
    .performance-table td:nth-child(14) {
        width: 100px;
        min-width: 100px;
    }
    
    /* 数据导入页面响应式 */
    .import-page .performance-table th,
    .import-page .performance-table td {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    .import-page .type-badge {
        padding: 4px 8px;
        font-size: 10px;
        min-width: 60px;
    }
    
    /* 新闻页面响应式 */
    .news-tab-content .news-control-panel {
        position: static;
        max-height: none;
        height: auto;
    }
    
    .news-tab-content .news-results-panel {
        height: auto;
        max-height: none;
    }
    
    .news-tab-content .news-control-panel .panel-title {
        padding: 15px 20px;
        margin: -20px -20px 20px -20px;
        font-size: 1.1em;
    }
}

/* 中等屏幕响应式 */
@media (max-width: 768px) {
    .app-container {
        padding: 15px 10px;
    }
    
    .header {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .header p {
        font-size: 1em;
    }
    
    .header-nav {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .header-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .stat-item {
        padding: 12px;
    }
    
    .stat-number {
        font-size: 1.6em;
    }
    
    .stat-label {
        font-size: 0.85em;
    }
    
    .nav-tabs {
        margin-bottom: 15px;
        padding: 3px;
        flex-wrap: wrap;
    }
    
    .nav-tab {
        padding: 10px 15px;
        font-size: 0.9em;
        flex: 1 1 auto;
        min-width: 120px;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .performance-stats-overview {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .performance-results-panel .results-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .performance-results-panel .results-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 12px;
        font-size: 0.85em;
    }
    
    .strategy-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .strategy-name {
        width: 100%;
    }
    
    .strategy-count {
        width: auto;
    }
    
    .single-panel-layout {
        gap: 20px;
    }
    
    .single-panel-layout .results-content,
    .single-panel-layout .analytics-content {
        gap: 20px;
    }
    
    /* 专业版页面响应式 */
    .advanced-results-table {
        font-size: 0.85em;
    }
    
    .advanced-results-table th,
    .advanced-results-table td {
        padding: 10px 8px;
    }
    
    /* 数据导入页面响应式 */
    .import-page .performance-table {
        font-size: 12px;
    }
    
    .import-page .performance-table th,
    .import-page .performance-table td {
        padding: 8px 6px;
    }
    
    .import-page .performance-table .date-cell {
        min-width: 100px;
        font-size: 11px;
    }
    
    .import-page .type-badge {
        padding: 3px 6px;
        font-size: 9px;
        min-width: 50px;
    }
    
    .import-page .performance-table .btn-success {
        padding: 6px 12px;
        font-size: 11px;
        min-width: 60px;
    }
    
    .import-page .file-table-header {
        font-size: 0.8em;
    }
    
    .import-page .file-table-row {
        font-size: 0.9em;
    }
    
    .import-page .file-table-header,
    .import-page .file-table-row {
        grid-template-columns: 1fr 100px 80px 120px 80px;
    }
    
    .import-page .type-badge {
        padding: 3px 8px;
        font-size: 0.7em;
    }
}

/* 小屏幕响应式 */
@media (max-width: 480px) {
    .header-stats,
    .stats-overview {
        grid-template-columns: 1fr;
    }
    
    .performance-header-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .performance-header-stats .stat-item {
        padding: 12px 16px;
    }
    
    .performance-header-stats .stat-number {
        font-size: 1.5em;
    }
    
    .performance-header-stats .stat-label {
        font-size: 0.8em;
    }
    
    .panel {
        padding: 15px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9em;
    }
    
    /* 专业版页面响应式 */
    .advanced-results-table {
        font-size: 0.8em;
    }
    
    .advanced-results-table th,
    .advanced-results-table td {
        padding: 8px 6px;
    }
    
    /* 表格列宽度进一步调整 */
    .advanced-results-table th:nth-child(1),
    .advanced-results-table td:nth-child(1) {
        width: 70px;
        min-width: 70px;
    }
    
    .advanced-results-table th:nth-child(2),
    .advanced-results-table td:nth-child(2) {
        width: 80px;
        min-width: 80px;
    }
    
    .advanced-results-table th:nth-child(3),
    .advanced-results-table td:nth-child(3) {
        width: 70px;
        min-width: 70px;
    }
    
    .advanced-results-table th:nth-child(4),
    .advanced-results-table td:nth-child(4) {
        width: 70px;
        min-width: 70px;
    }
    
    .advanced-results-table th:nth-child(5),
    .advanced-results-table td:nth-child(5) {
        width: 80px;
        min-width: 80px;
    }
    
    .advanced-results-table th:nth-child(6),
    .advanced-results-table td:nth-child(6) {
        width: 80px;
        min-width: 80px;
    }
    
    .advanced-results-table th:nth-child(7),
    .advanced-results-table td:nth-child(7) {
        width: 50px;
        min-width: 50px;
    }
    
    /* 收益分析页面响应式 */
    .performance-table {
        font-size: 0.8em;
    }
    
    .performance-table th,
    .performance-table td {
        padding: 8px 6px;
    }
    
    /* 表格列宽度进一步调整 */
    .performance-table th:nth-child(1),
    .performance-table td:nth-child(1) {
        width: 70px;
        min-width: 70px;
    }
    
    .performance-table th:nth-child(2),
    .performance-table td:nth-child(2) {
        width: 70px;
        min-width: 70px;
    }
    
    .performance-table th:nth-child(3),
    .performance-table td:nth-child(3) {
        width: 80px;
        min-width: 80px;
    }
    
    .performance-table th:nth-child(4),
    .performance-table td:nth-child(4) {
        width: 80px;
        min-width: 80px;
    }
    
    .performance-table th:nth-child(5),
    .performance-table td:nth-child(5) {
        width: 70px;
        min-width: 70px;
    }
    
    .performance-table th:nth-child(6),
    .performance-table td:nth-child(6) {
        width: 70px;
        min-width: 70px;
    }
    
    .performance-table th:nth-child(7),
    .performance-table td:nth-child(7) {
        width: 70px;
        min-width: 70px;
    }
    
    .performance-table th:nth-child(8),
    .performance-table td:nth-child(8) {
        width: 70px;
        min-width: 70px;
    }
    
    .performance-table th:nth-child(9),
    .performance-table td:nth-child(9) {
        width: 70px;
        min-width: 70px;
    }
    
    .performance-table th:nth-child(10),
    .performance-table td:nth-child(10) {
        width: 70px;
        min-width: 70px;
    }
    
    .performance-table th:nth-child(11),
    .performance-table td:nth-child(11) {
        width: 70px;
        min-width: 70px;
    }
    
    .performance-table th:nth-child(12),
    .performance-table td:nth-child(12) {
        width: 70px;
        min-width: 70px;
    }
    
    .performance-table th:nth-child(13),
    .performance-table td:nth-child(13) {
        width: 70px;
        min-width: 70px;
    }
    
    .performance-table th:nth-child(14),
    .performance-table td:nth-child(14) {
        width: 80px;
        min-width: 80px;
    }
    
    /* 数据导入页面响应式 */
    .import-page .performance-table {
        font-size: 0.8em;
    }
    
    .import-page .performance-table th,
    .import-page .performance-table td {
        padding: 8px 6px;
    }
    
    /* 表格列宽度进一步调整 */
    .import-page .performance-table th:nth-child(1),
    .import-page .performance-table td:nth-child(1) {
        width: 70px;
        min-width: 70px;
        max-width: 70px;
    }
    
    .import-page .performance-table th:nth-child(2),
    .import-page .performance-table td:nth-child(2) {
        width: 70px;
        min-width: 70px;
        max-width: 70px;
    }
    
    .import-page .performance-table th:nth-child(3),
    .import-page .performance-table td:nth-child(3) {
        width: 80px;
        min-width: 80px;
        max-width: 80px;
    }
    
    .import-page .performance-table th:nth-child(4),
    .import-page .performance-table td:nth-child(4) {
        width: 80px;
        min-width: 80px;
        max-width: 80px;
    }
    
    .import-page .performance-table th:nth-child(5),
    .import-page .performance-table td:nth-child(5) {
        width: 70px;
        min-width: 70px;
        max-width: 70px;
    }
    
    .import-page .performance-table th:nth-child(6),
    .import-page .performance-table td:nth-child(6) {
        width: 70px;
        min-width: 70px;
        max-width: 70px;
    }
    
    /* 数据导入页面响应式 */
    .import-page .file-table-header {
        display: none;
    }
    
    .import-page .file-table-row {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .import-page .file-col-name, 
    .import-page .file-col-type, 
    .import-page .file-col-size, 
    .import-page .file-col-time {
        justify-content: space-between;
    }
    
    .import-page .file-col-action {
        justify-content: center;
        margin-top: 10px;
    }
    
    /* 收益分析页面响应式 */
    .performance-stats-overview {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================ 
   专业版页面表格列宽度优化
   ============================================================================ */

/* 专业版页面表格列宽度优化 */
.advanced-results-table th:nth-child(1), /* 股票代码 */
.advanced-results-table td:nth-child(1) {
    width: 100px;
    min-width: 100px;
}

.advanced-results-table th:nth-child(2), /* 股票名称 */
.advanced-results-table td:nth-child(2) {
    width: 120px;
    min-width: 120px;
}

.advanced-results-table th:nth-child(3), /* 当前价格 */
.advanced-results-table td:nth-child(3) {
    width: 100px;
    min-width: 100px;
    text-align: right;
}

.advanced-results-table th:nth-child(4), /* 涨跌幅 */
.advanced-results-table td:nth-child(4) {
    width: 100px;
    min-width: 100px;
    text-align: right;
    font-weight: 600;
}

.advanced-results-table th:nth-child(5), /* 净流入 */
.advanced-results-table td:nth-child(5) {
    width: 120px;
    min-width: 120px;
    text-align: right;
}

.advanced-results-table th:nth-child(6), /* 策略类型 */
.advanced-results-table td:nth-child(6) {
    width: 120px;
    min-width: 120px;
}

.advanced-results-table th:nth-child(7), /* 操作 */
.advanced-results-table td:nth-child(7) {
    width: 80px;
    min-width: 80px;
    text-align: center;
}

/* ============================================================================ 
   设置新的列宽 - 让表格占满整个内容区
   ============================================================================ */

.import-page .performance-table th:nth-child(1),
.import-page .performance-table td:nth-child(1) {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
}

.import-page .performance-table th:nth-child(2),
.import-page .performance-table td:nth-child(2) {
    width: 300px;
    min-width: 200px;
}

.import-page .performance-table th:nth-child(3),
.import-page .performance-table td:nth-child(3) {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

.import-page .performance-table th:nth-child(4),
.import-page .performance-table td:nth-child(4) {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

.import-page .performance-table th:nth-child(5),
.import-page .performance-table td:nth-child(5) {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

.import-page .performance-table th:nth-child(6),
.import-page .performance-table td:nth-child(6) {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
}

/* ============================================================================ 
   统一的面板内容样式
   ============================================================================ */

.panel > div:not(.panel-title) {
    flex-grow: 1;
    overflow-y: auto;
}

/* 统一收益分析和数据导入页面表格行高 */
.performance-table-container tbody tr,
.import-page .table-container tbody tr {
    height: 60px;
}

/* 统一的结果面板样式 */
.results-panel {
    grid-column: 1 / -1;
    width: 100%;
}

/* 统一的数据分析面板样式 */
.analytics-panel {
    grid-column: 1 / -1;
    width: 100%;
}

/* 统一的响应式设计 */
@media (max-width: 1200px) {
    .performance-page .tab-content,
    .import-page .tab-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Advanced page right column compact strategy info styles */
.advanced-page .strategy-info-panel {
    margin: 0;
    padding: 0;
}
.advanced-page .strategy-info-panel .panel-title {
    margin: 0;
    padding: 10px 12px;
}
.advanced-page .strategy-info-panel .strategy-info-content {
    padding: 10px 12px;
}
.advanced-page .strategy-info-panel .strategy-info-content p {
    margin: 6px 0;
}
